Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
prosemirror-gapcursor
Advanced tools
ProseMirror plugin for cursors at normally impossible-to-reach positions
The prosemirror-gapcursor package provides a way to handle cursor behavior in ProseMirror editors when the cursor is positioned in places where a regular text cursor would not normally be able to go, such as between block nodes.
Gap Cursor Plugin
This feature provides a plugin that can be added to a ProseMirror editor to enable gap cursor functionality. The code sample demonstrates how to create an editor state with the gap cursor plugin and initialize an editor view with that state.
const { gapCursor } = require('prosemirror-gapcursor');
const { EditorState } = require('prosemirror-state');
const { EditorView } = require('prosemirror-view');
const { schema } = require('prosemirror-schema-basic');
const state = EditorState.create({
schema,
plugins: [gapCursor()]
});
const view = new EditorView(document.querySelector('#editor'), {
state
});
Custom Gap Cursor Behavior
This feature allows customization of the gap cursor behavior. The code sample shows how to create a custom gap cursor plugin with a specific class name and an event handler for when the gap cursor is entered.
const { gapCursor } = require('prosemirror-gapcursor');
const { Plugin } = require('prosemirror-state');
const customGapCursor = gapCursor({
className: 'my-gap-cursor',
onGapCursorEnter: (state, dispatch) => {
console.log('Gap cursor entered');
}
});
const state = EditorState.create({
schema,
plugins: [customGapCursor]
});
The prosemirror-tables package provides table-related functionality for ProseMirror editors, including table creation, editing, and cursor behavior within tables. While it focuses on tables rather than general gap cursor behavior, it offers similar cursor management features within the context of tables.
The prosemirror-schema-list package provides schema and commands for working with lists in ProseMirror editors. It includes functionality for handling cursor behavior within lists, which can be seen as somewhat similar to the gap cursor functionality provided by prosemirror-gapcursor.
[ WEBSITE | ISSUES | FORUM | CHANGELOG ]
This is a core module of ProseMirror. ProseMirror is a well-behaved rich semantic content editor based on contentEditable, with support for collaborative editing and custom document schemas.
This plugin implements a
block-level cursor that can be used to focus places that don't allow
regular selection (such as positions that have a leaf block node,
table, or the end of the document both before and after them). Make
sure you load style/gapcursor.css
(or define your own styling for
the cursor).
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license. There's a forum for general discussion and support requests, and the Github bug tracker is the place to report issues.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
FAQs
ProseMirror plugin for cursors at normally impossible-to-reach positions
We found that prosemirror-gapcursor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.